package com.ysd.dao.impl;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.ysd.entity.AnLi;
import com.ysd.entity.JuTiXinWen;
import com.ysd.util.DBManager;

public class AnLiDaoImpl {
	public List<AnLi> getAnLi() {
		List<AnLi> AnLi = new ArrayList<AnLi>();
		Connection conn = DBManager.getConnection();
		Statement st = null;
		ResultSet rs = null;
		AnLi anLi = null;
		try {
			st = conn.createStatement();
			rs = st.executeQuery("select * from anLi");
			while(rs.next()) {
				int anLiId = rs.getInt("anLiId");
				String anLiTitle = rs.getString("anLiTitle");
				String anLiContent = rs.getString("anLiContent");
				
				anLi = new AnLi(anLiId, anLiTitle, anLiContent); 
				AnLi.add(anLi);
			}
			return AnLi;
		} catch (SQLException e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
			return null;
		}finally {
			DBManager.closeAll(conn, st, rs);
		}
	}
}
